package ma.ensao.egicom.core.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class MarketorderlineId implements java.io.Serializable {

    private int marketorderlineid;

    private int marketorderid;

    private int productid;

    public MarketorderlineId() {
    }

    public MarketorderlineId(int marketorderlineid, int marketorderid, int productid) {
        this.marketorderlineid = marketorderlineid;
        this.marketorderid = marketorderid;
        this.productid = productid;
    }

    @Column(name = "marketorderlineid", nullable = false)
    public int getMarketorderlineid() {
        return this.marketorderlineid;
    }

    public void setMarketorderlineid(int marketorderlineid) {
        this.marketorderlineid = marketorderlineid;
    }

    @Column(name = "marketorderid", nullable = false)
    public int getMarketorderid() {
        return this.marketorderid;
    }

    public void setMarketorderid(int marketorderid) {
        this.marketorderid = marketorderid;
    }

    @Column(name = "productid", nullable = false)
    public int getProductid() {
        return this.productid;
    }

    public void setProductid(int productid) {
        this.productid = productid;
    }

    public boolean equals(Object other) {
        if ((this == other)) return true;
        if ((other == null)) return false;
        if (!(other instanceof MarketorderlineId)) return false;
        MarketorderlineId castOther = (MarketorderlineId) other;

        return (this.getMarketorderlineid() == castOther.getMarketorderlineid()) && (this.getMarketorderid() == castOther.getMarketorderid())
            && (this.getProductid() == castOther.getProductid());
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + this.getMarketorderlineid();
        result = 37 * result + this.getMarketorderid();
        result = 37 * result + this.getProductid();
        return result;
    }

}
